home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbchat1a / chat2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-30  |  8.5 KB  |  258 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H8000000C&
  5.    Caption         =   "Server"
  6.    ClientHeight    =   4710
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   5310
  10.    LinkTopic       =   "Form1"
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   4710
  13.    ScaleWidth      =   5310
  14.    WindowState     =   2  'Maximized
  15.    Begin VB.TextBox Text4 
  16.       Height          =   285
  17.       Left            =   0
  18.       TabIndex        =   9
  19.       Top             =   4320
  20.       Width           =   2415
  21.    End
  22.    Begin VB.PictureBox Picture1 
  23.       Appearance      =   0  'Flat
  24.       BackColor       =   &H80000005&
  25.       ForeColor       =   &H80000008&
  26.       Height          =   3435
  27.       Index           =   0
  28.       Left            =   0
  29.       ScaleHeight     =   3405
  30.       ScaleWidth      =   4935
  31.       TabIndex        =   0
  32.       Top             =   0
  33.       Visible         =   0   'False
  34.       Width           =   4965
  35.       Begin VB.CommandButton Command3 
  36.          Caption         =   "Conn."
  37.          Height          =   255
  38.          Index           =   0
  39.          Left            =   4320
  40.          TabIndex        =   8
  41.          Top             =   3120
  42.          Width           =   615
  43.       End
  44.       Begin VB.PictureBox Picture2 
  45.          BackColor       =   &H80000002&
  46.          BorderStyle     =   0  'None
  47.          Height          =   255
  48.          Index           =   0
  49.          Left            =   0
  50.          ScaleHeight     =   255
  51.          ScaleWidth      =   4935
  52.          TabIndex        =   3
  53.          Top             =   0
  54.          Width           =   4935
  55.          Begin VB.CommandButton Command1 
  56.             Caption         =   "X"
  57.             BeginProperty Font 
  58.                Name            =   "MS Sans Serif"
  59.                Size            =   8.25
  60.                Charset         =   0
  61.                Weight          =   700
  62.                Underline       =   0   'False
  63.                Italic          =   0   'False
  64.                Strikethrough   =   0   'False
  65.             EndProperty
  66.             Height          =   255
  67.             Index           =   0
  68.             Left            =   4680
  69.             TabIndex        =   5
  70.             Top             =   0
  71.             Width           =   255
  72.          End
  73.          Begin VB.CommandButton Command2 
  74.             Caption         =   "_"
  75.             BeginProperty Font 
  76.                Name            =   "MS Sans Serif"
  77.                Size            =   8.25
  78.                Charset         =   0
  79.                Weight          =   700
  80.                Underline       =   0   'False
  81.                Italic          =   0   'False
  82.                Strikethrough   =   0   'False
  83.             EndProperty
  84.             Height          =   255
  85.             Index           =   0
  86.             Left            =   4440
  87.             TabIndex        =   6
  88.             Top             =   0
  89.             Width           =   255
  90.          End
  91.          Begin VB.Label Label1 
  92.             AutoSize        =   -1  'True
  93.             BackStyle       =   0  'Transparent
  94.             Caption         =   "Username"
  95.             BeginProperty Font 
  96.                Name            =   "System"
  97.                Size            =   9.75
  98.                Charset         =   0
  99.                Weight          =   700
  100.                Underline       =   -1  'True
  101.                Italic          =   0   'False
  102.                Strikethrough   =   0   'False
  103.             EndProperty
  104.             ForeColor       =   &H80000009&
  105.             Height          =   240
  106.             Index           =   0
  107.             Left            =   120
  108.             TabIndex        =   4
  109.             Top             =   0
  110.             Width           =   1005
  111.          End
  112.       End
  113.       Begin VB.TextBox Text2 
  114.          Height          =   285
  115.          Index           =   0
  116.          Left            =   0
  117.          TabIndex        =   2
  118.          Top             =   3120
  119.          Width           =   4335
  120.       End
  121.       Begin VB.TextBox Text1 
  122.          Height          =   2895
  123.          Index           =   0
  124.          Left            =   0
  125.          Locked          =   -1  'True
  126.          MultiLine       =   -1  'True
  127.          ScrollBars      =   2  'Vertical
  128.          TabIndex        =   1
  129.          Top             =   240
  130.          Width           =   4935
  131.       End
  132.    End
  133.    Begin VB.TextBox Text3 
  134.       Height          =   4095
  135.       Left            =   0
  136.       Locked          =   -1  'True
  137.       MultiLine       =   -1  'True
  138.       TabIndex        =   7
  139.       Top             =   0
  140.       Width           =   5055
  141.    End
  142. Attribute VB_Name = "Form1"
  143. Attribute VB_GlobalNameSpace = False
  144. Attribute VB_Creatable = False
  145. Attribute VB_PredeclaredId = True
  146. Attribute VB_Exposed = False
  147. Dim MouseStartX, MouseStarty
  148. Sub loadfrm(maxd)
  149. On Error Resume Next
  150. Load Picture1(maxd)
  151. Picture1(maxd).Visible = True
  152. Picture1(maxd).Left = Picture1(maxd - 1).Left + 500
  153. Picture1(maxd).Top = Picture1(maxd - 1).Top + 500
  154. Picture1(maxd).ZOrder 0
  155. Load Picture2(maxd)
  156. Set Picture2(maxd).Container = Picture1(maxd)
  157.  Picture2(maxd).Visible = True
  158.  Load Label1(maxd)
  159. Set Label1(maxd).Container = Picture2(maxd)
  160. Label1(maxd).Visible = True
  161.  Load Text1(maxd)
  162. Set Text1(maxd).Container = Picture1(maxd)
  163. Text1(maxd).Visible = True
  164. Text1(maxd).Text = ""
  165.  Load Text2(maxd)
  166. Set Text2(maxd).Container = Picture1(maxd)
  167. Text2(maxd).Visible = True
  168. Text2(maxd).Text = ""
  169.  Load Command1(maxd)
  170. Set Command1(maxd).Container = Picture1(maxd)
  171. Command1(maxd).Visible = True
  172.  Load Command2(maxd)
  173. Set Command2(maxd).Container = Picture1(maxd)
  174. Command2(maxd).Visible = True
  175. Command1(maxd).ZOrder 0
  176. Load Command3(maxd)
  177. Set Command3(maxd).Container = Picture1(maxd)
  178. Command3(maxd).Visible = True
  179. Command3(maxd).ZOrder 0
  180. End Sub
  181. Private Sub Command1_Click(Index As Integer)
  182. On Error Resume Next
  183. Picture1(Index).ZOrder 0
  184. MDIForm1.sck.SendData "kick=>:" & Label1(Index).Caption & "=>:" & user.Nickname
  185. Picture1(Index).Visible = False
  186. MDIForm1.Command1(Index).Visible = False
  187. End Sub
  188. Private Sub Command2_Click(Index As Integer)
  189. On Error Resume Next
  190. Picture1(Index).ZOrder 0
  191. Picture1(Index).Visible = False
  192. End Sub
  193. Private Sub Command3_Click(Index As Integer)
  194. On Error Resume Next
  195. Dim res As VbMsgBoxResult
  196. res = MsgBox("Do you want to chat to " & Label1(Index).Caption & "?", vbYesNo)
  197. If res = vbYes Then
  198. MDIForm1.sck.SendData "ping=>:" & Label1(Index).Caption & "=>:" & user.Nickname
  199. Command3(Index).Visible = False
  200. Text2(Index).Width = Picture1(Index).Width
  201. End If
  202. End Sub
  203. Private Sub Form_Resize()
  204. On Error Resume Next
  205. Text3.Width = Me.ScaleWidth
  206. Text3.Height = Me.ScaleHeight - Text4.Height
  207. Text4.Top = Me.ScaleHeight - Text4.Height
  208. Text4.Width = Me.ScaleWidth
  209. End Sub
  210. Private Sub Label1_Click(Index As Integer)
  211. Picture1(Index).ZOrder 0
  212. End Sub
  213. Private Sub Picture1_GotFocus(Index As Integer)
  214. Picture1(Index).ZOrder 0
  215. End Sub
  216. Private Sub Picture2_Click(Index As Integer)
  217. Picture1(Index).ZOrder 0
  218. End Sub
  219. Private Sub Picture2_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  220. MouseStartX = X
  221. MouseStarty = Y
  222. End Sub
  223. Private Sub Picture2_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  224.   If Button = vbLeftButton Then
  225.      Picture1(Index).Left = Picture1(Index).Left - (MouseStartX - X)
  226.          Picture1(Index).Top = Picture1(Index).Top - (MouseStarty - Y)
  227.     End If
  228. End Sub
  229. Private Sub Text1_Change(Index As Integer)
  230. Picture1(Index).ZOrder 0
  231. End Sub
  232. Private Sub Text1_GotFocus(Index As Integer)
  233. Picture1(Index).ZOrder 0
  234. End Sub
  235. Private Sub Text2_Change(Index As Integer)
  236. Picture1(Index).ZOrder 0
  237. End Sub
  238. Private Sub Text2_GotFocus(Index As Integer)
  239. Picture1(Index).ZOrder 0
  240. End Sub
  241. Private Sub Text2_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
  242. On Error Resume Next
  243. If KeyCode = vbKeyReturn Then
  244. MDIForm1.sck.SendData "mess=>:" & Label1(Index).Caption & "=>:" & user.Nickname & "=>:" & Text2(Index).Text
  245. Text1(Index).SelStart = Len(Text1(Index).Text)
  246. Text1(Index).SelText = vbCrLf
  247. Text1(Index).SelText = "<<" & user.Nickname & ">> " & Text2(Index).Text & vbCrLf
  248. Text2(Index).Text = ""
  249. End If
  250. End Sub
  251. Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
  252. On Error Resume Next
  253. If KeyCode = vbKeyReturn Then
  254. MDIForm1.sck.SendData "serv=>:" & user.Nickname & "=>:" & Text4.Text
  255. Text4.Text = ""
  256. End If
  257. End Sub
  258.